unit UGetStrValue;

interface
uses StrUtils;
function GetStrValue(Str: String; Simbol:char; PosSimb: integer): String;

implementation
function GetStrValue(Str: String; Simbol:char; PosSimb: integer): String;
var Offset, Pos, PrevPos :Integer;
begin
    Offset := 1;
    Pos := 0;
    repeat
        PrevPos := Pos;
        Pos := PosEx(Simbol,Str, Offset);
        if(Pos = 0) then begin
            Result := ''; exit;
        end;
        Offset := Pos + 1;
        PosSimb := PosSimb - 1;
    until PosSimb = 0;

    Result := Copy(Str, PrevPos + 1, Pos - PrevPos - 1);
end;

end.
 